package fm.admin.controller;

import fm.cache.AreaCache;
import fm.controller.BaseController;
import fm.dto.NeiyiUser;
import fm.mongoService.UserService;
import fm.web.CurrentRequest;
import fm.yichenet.mongo.service.MerchantUserService;
import fm.yichenet.service.AdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by CM on 17/5/30.
 */
@Controller
@RequestMapping("/per-shop")
public class PersonShopMgrController extends BaseController {
    @Autowired
    UserService userService;
    @Autowired
    AdminUserService adminUserService;
    @Autowired
    MerchantUserService merchantUserService;

    @RequestMapping("/index")
    public String index(ModelMap modelMap) throws Exception {
        modelMap.put("citys", AreaCache.getAllProvince());
        modelMap.put("uid", CurrentRequest.getCurrentUserId());
        return "/admin/per-shop/index";
    }


    @RequestMapping("/portal")
    public String portalConfig(ModelMap modelMap) throws Exception {
        NeiyiUser user = (NeiyiUser) CurrentRequest.getCurrentUser();
        modelMap.put("data", user);
        return "/admin/per-shop/portal";
    }

    @RequestMapping("/aut")
    public String aut(ModelMap modelMap) {
        return "/admin/per-shop/aut";
    }


}
